<?php
class Application_Model_DbTable_Constant extends Zend_Db_Table_Abstract {
	protected $_name = 'tbl_constant';
	protected $_primary = 'constant_id';
	
	public function getList($filters = array(),$sortType = "ASC",$sortBy = null){
		$select = $this->select()
		->from($this->_name);
		if( count($filters) > 0 ){
			foreach($filters as $key => $value){
				if($key=="keyword" && trim($value)!=""){
					$select->where("constant_name like ?","%$value%");					
				}
			}
		}
	
		if($sortBy==null){
			$sortBy = "constant_code";
			$sortType = "asc";
		}
		$select->order($sortBy . " " . $sortType);
	
		return $result = $this->fetchAll($select)->toArray();
	}
}
?>